package hkr.vfu.bluecenter.backend;

import java.io.Serializable;

/**
 * Created by mattiasbowallius on 20/12/13.
 */
public class BoxVO implements Serializable {

    private String name;
    private SensorVO[] sensors;
    private String logName;

    public BoxVO(String name) {
        this.name = name;
        this.logName = "default.txt";
        sensors = new SensorVO[2];
        sensors[0] = new SensorVO();
        sensors[1] = new SensorVO();
    }

    public SensorVO[] getSensors() {
        return sensors;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setNumberOfSensors(int numberOfSensors) {
        int oldSize = sensors.length;
        SensorVO[] temp = new SensorVO[numberOfSensors];

        for (int i = 0; i < numberOfSensors; i++) {
            if (i < oldSize) {
                temp[i] = sensors[i];
            } else {
                temp[i] = new SensorVO();
            }
        }
        sensors = temp;
    }

    public String getLogName() {
        return logName;
    }

    public void setLogName(String logName) {
        this.logName = logName;
    }
}
